-
Notifications
You must be signed in to change notification settings - Fork 151
[WIP] Add PyTorch-Warp interoperability in Chapter 12 notebook #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Show resolved
Hide resolved
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "Let us define the backward function for our optimization and register it using `register_autograd` for our `warp_rosenbrock` operator" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess there's sort of a plummet in quality after this and we just have the reader execute code block after code block, not expecting if they should see anything after executing one or what the code block is doing. Are you able to improve the flow (from your perspective as someone who probably hasn't seen this example before)?
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Show resolved
Hide resolved
| "nbconvert_exporter": "python", | ||
| "pygments_lexer": "ipython3", | ||
| "version": "3.12.3" | ||
| "version": "undefined.undefined.undefined" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure how it got to be "version": "undefined.undefined.undefined"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure what happened there. In my current push, it shows 3.11.11
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "# Our backward functions is warp_rosenbrock_backward, being wrapped def backward(...) wraps it\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- functions -> function
- warp_rosenbrock_backward ->
warp_rosenbrock_backward - "being wrapped def backward(...) wraps it" is kind of a nonsense comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lol, what was I thinking writing that comment in the third bullet, fixed now
| ] | ||
| }, | ||
| { | ||
| "cell_type": "code", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need a markdown cell before each block of code that explains what the following code block does
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
Accelerated_Python_User_Guide/notebooks/Chapter_12_Intro_to_NVIDIA_Warp.ipynb
Outdated
Show resolved
Hide resolved
| "cell_type": "markdown", | ||
| "metadata": {}, | ||
| "source": [ | ||
| "In the GIF above, the red star represents the optimum, the white dot shows the mean of $(x, y)$ coordinates across all 1500 points, and the black dots are the individual points. As the optimization progresses, both the white dot and the individual black dots converge toward the red star, validating our hybrid PyTorch-Warp optimization scheme for the Rosenbrock function." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There should be some acknowledgement here about the simplicity of the example. The PyTorch custom operator was extremely simple and this optimization problem can be easily done in PyTorch without going to a kernel-based framework like Warp. We should have the reader recognize that instead of simplify evaluating a function, their custom operators might contain entire simulators with multiple kernel launches that might also use Warp's built-in spatial data structures.
Added a section on PyTorch-Warp interoperability towards the end of Chapter 12 notebook.